package com.yss.reportworld.domain;

import java.util.Date;
import java.util.List;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yss.common.core.web.domain.BaseEntity;

/**
 * SQL脚本管理对象 report_world_sql_script
 *
 * @author yss
 * @date 2023-03-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("report_world_sql_script")
public class SqlScript extends BaseEntity {

    /**
     * 编号
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    /**
     * SQL脚本
     */
    @ExcelIgnore
    @TableField("SQL_SCRIPT")
    private String sqlScript;

    /**
     * 所属客户
     */
    @ExcelIgnore
    @TableField("CUSTOMER_ID")
    private String customerId;

    /**
     * 所属报表
     */
    @ExcelIgnore
    @TableField("REPORT_ID")
    private String reportId;

    /**
     * 所属模块
     */
    @ExcelIgnore
    @TableField("MODULAR_ID")
    private String modularId;

    /**
     * 需求BUG编号
     */
    @ExcelIgnore
    @TableField("DEMAND_BUG_ID")
    private String demandBugId;

    /**
     * SQL 类型
     */
    @ExcelIgnore
    @TableField("FTYPE")
    private Integer ftype;

    /**
     * 报表世界所在分层
     */
    @ExcelIgnore
    @TableField("LAYERED")
    private Integer layered;

    /**
     * 来源
     */
    @ExcelIgnore
    @TableField("FSOURCE")
    private Integer fsource;

    /**
     * 数据库类型
     */
    @ExcelIgnore
    @TableField("DATABASE_TYPE")
    private String dataBaseType;

    /**
     * 是否同时存在
     */
    @ExcelIgnore
    @TableField("COVER_PRIMARY_KEY")
    private Integer coverPrimaryKey;

    /**
     * 是否更新数据标记
     */
    @ExcelIgnore
    @TableField("DATA_MARK")
    private Integer dataMark;

    /**
     * 是否同步更新后续版本
     */
    @ExcelIgnore
    @TableField("FOLLOW_UP_VERSION")
    private Integer followUpVersion;

    /**
     * 版本号
     */
    @ExcelProperty(value = "版本号")
    @TableField("VERSION")
    private String version;

    /**
     * 状态
     */
    @ExcelIgnore
    @TableField("STATUS")
    private Integer status;

    /**
     * 审核人
     */
    @ExcelIgnore
    @TableField("APPROVAL_BY")
    private String approvalBy;

    /**
     * 审核时间
     */
    @ExcelIgnore
    @TableField("APPROVAL_TIME")
    private Date approvalTime;

    /**
     * 退回原因
     */
    @ExcelIgnore
    @TableField("APPROVAL_REASON")
    private String approvalReason;

    /**
     * 检查的日志信息
     */
    @ExcelIgnore
    @TableField("CHECK_LOGGER")
    private String checkLogger;


    /**
     * 历史版本号
     */
    @ExcelIgnore
    @TableField(exist = false)
    private String hisVersion;

    //前台页面查询获取到的集合信息
    // 所属模块
    @ExcelIgnore
    @TableField(exist = false)
    private List<String> strModular;
    //所属客户
    @ExcelIgnore
    @TableField(exist = false)
    private List<String> strCustomer;
    //所属报表
    @ExcelIgnore
    @TableField(exist = false)
    private List<String> strReport;


    // 所属模块
    @ExcelIgnore
    @TableField(exist = false)
    private String modularName;
    //所属客户
    @ExcelProperty(value = "所属客户")
    @TableField(exist = false)
    private String customerName;
    //所属报表
    @ExcelProperty(value = "所属报表")
    @TableField(exist = false)
    private String reportName;


    //判断是否选是修改按钮
    @ExcelIgnore
    @TableField(exist = false)
    private Integer isShowUpdate;

    @ExcelIgnore
    @TableField(exist = false)
    private List<String> idList;

    /**
     * 版本号后缀
     */
    @ExcelIgnore
    @TableField(exist = false)
    private String versionSuffix;

    //需求BUG编号
    @ExcelProperty(value = "需求BUG编号")
    @TableField(exist = false)
    private String demandBugNum;

    @ExcelProperty(value = "需求/BUG", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=需求,2=BUG")
    @TableField(exist = false)
    private Integer demandBugType;

    @ExcelProperty(value = "外部/内部", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=外部,2=内部")
    @TableField(exist = false)
    private Integer demandBugFsource;

    @ExcelProperty(value = "需求内容")
    @TableField(exist = false)
    private String description;

    @ExcelProperty(value = "描述信息")
    @TableField(exist = false)
    private String execlRemark;


    // 导出的时候选择 数据的主键
    @ExcelIgnore
    @TableField(exist = false)
    private String ids;
}
